<cfcomponent>
	
	<cffunction name="init" access="public" returntype="CategoryService" output="false">
		<cfreturn this />
	</cffunction>
	
	<cffunction name="saveNewCategory" output="false" access="public" returntype="string" hint="I save a new category">
		<cfargument name="CategoryName" type="string" required="true"/>
		<cfset var CategoryBean = makeCategoryBean() />
		<cfset CategoryBean.setCategoryName( arguments.CategoryName ) />
		<cfset getCategoryDAO().save( CategoryBean ) />
		<cfreturn CategoryBean.getCategoryID() />
	</cffunction>

	<cffunction name="makeCategoryBean" output="false" access="private" returntype="any" hint="">
		<cfreturn getLightWire().getBean("CategoryBean") />	
	</cffunction>

	<cffunction name="getLightWire" access="public" output="false" returntype="any">
		<cfreturn variables.instance.LightWire />
	</cffunction>
	
	<cffunction name="setLightWire" access="public" output="false" returntype="void">
		<cfargument name="LightWire" type="any" required="true" />
		<cfset variables.instance.LightWire = arguments.LightWire />
	</cffunction>
	
	<cffunction name="getCategoryDAO" access="public" output="false" returntype="any">
		<cfreturn variables.instance.CategoryDAO />
	</cffunction>
	
	<cffunction name="setCategoryDAO" access="public" output="false" returntype="void">
		<cfargument name="CategoryDAO" type="any" required="true" />
		<cfset variables.instance.CategoryDAO = arguments.CategoryDAO />
	</cffunction>
	
</cfcomponent>